#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int NN=2e6+4;
int a[NN],b[NN];
ll val[NN];
pair<ll,int>w[NN];
void solve()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for(int i=1;i<n;i++)
        scanf("%d",&a[i]);
    for(int i=1;i<=k;i++)
        scanf("%d",&b[i]);
    for(int i=1;i<=n;i++)
    {
        val[i]=val[i-1];
        if(i<=k)
            val[i]+=b[i];
        if(i>n-k+1)
            val[i]-=b[i-(n-k)-1];
    }
    int l=0,r=min(a[k-1],a[k-2]);
    while(l<r)
    {
        int mid=l+(r-l)/2;
        if(calc1(mid))
    }
    w[k-1]={0,1};
    ll l=0,r=a[k-1],res=val[k-1],sum;
    for(int i=k-2;i>=1;i--)
    {
        w[i]={a[i]-w[i+1].first,-w[i+1].second};
        sum+=w[i].first*val[i];
        res+=w[i].second*val[i];
        if(w[i].second<0)
            l=max(l,w[i].first-a[i]),r=min(r,w[i].first);
        else
            l=max(l,-w[i].first),r=min(r,a[i]-w[i].first);
    }
    int ans1[2]={0};
    ans1[l%2]=max(ans1[l%2],l*res+sum-(l/2)*val[k]);
    
    if(res*2>=val[k])
    {
        ans1[0]=;
    }
    else
    {
        
    }
    //w[x%2]=max{x*res+sum-(x/2)*val[k]};
    //x+2->+res*2-val[k]
}
int main()
{
    int t;
    scanf("%*d%d",&t);
    while(t--)
        solve();
    return 0;
}